
<template>
  <el-config-provider :locale="lang">
    <NuxtLayout>
      <NuxtPage />
    </NuxtLayout>
  </el-config-provider>
</template>

<script setup lang="ts">
import en from 'element-plus/es/locale/lang/en'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

const lang = ref(zhCn)
const languages: any = { zh: zhCn, en }
const { locale } = useI18n()
watch(
  () => locale.value,
  (val) => {
    lang.value = languages[val]
  },
  { immediate: true },
)
</script>
